/**
 * 项目名：泰禾资产
 * 包名：com.pactera.config.security
 * 文件名：SelfUserDetails.java
 * 版本信息：1.0.0
 * 日期：2019年1月8日-下午3:26:38
 * Copyright (c) 2019 Pactera 版权所有
 */
 
package com.pactera.config.security;

import java.io.Serializable;
import java.util.Collection;
import java.util.Set;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

public class SelfUserDetails implements UserDetails, Serializable {
	
    private static final long serialVersionUID = 7171722954972237961L;
 
    private String id;
    private String username;
    private String password;
    private Set<? extends GrantedAuthority> authorities;
 
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return this.authorities;
    }
 
    public void setAuthorities(Set<? extends GrantedAuthority> authorities) {
        this.authorities = authorities;
    }
 
    @Override
    public String getPassword() { // 最重点Ⅰ
        return this.password;
    }
 
    @Override
    public String getUsername() { // 最重点Ⅱ
        return this.username;
    }
 
    public void setUsername(String username) {
        this.username = username;
    }
 
    public void setPassword(String password) {
        this.password = password;
    }
 
    //账号是否过期
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }
 
    //账号是否锁定
    @Override
    public boolean isAccountNonLocked() {
        return true;
    }
 
    //账号凭证是否未过期
    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }
 
    @Override
    public boolean isEnabled() {
        return true;
    }

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
}
